<form class="layui-form search-form" lay-filter="search-form" style="display: flex;flex-wrap: wrap;flex: 1">
    <input type="hidden" name="is_search" value="1"/>

    <?php $revoke = false;?>

    {foreach name="search" item="vo" key='key'}

    <div class="layui-form-item  {if $vo.type == 'linkage'}layui-col-xs3{else}layui-col-xs2{/if} {if $key >= 6} hidden layui-hide{/if}">
        <?php if(request()->param($vo['key']))$revoke = true; ?>
        {switch vo.type}
        {case value="input"}
        <div class="layui-inline" style="width: 98%">
            <input class="layui-input"  placeholder="{$vo.name}筛选" name="{$vo.key}" value="<?php echo request()->param($vo['key']);?>"/>
        </div>
        {/case}
        {case value="select"}
        <div class="layui-inline" style="width: 98%">
            <select name="{$vo.key}">
                <option value="">{$vo.name}</option>
                {foreach name="vo.value" key="key" item="co"}
                <?php if(request()->param($vo['key']) == $key){ ?>
                <option value="{$key}" selected>{$co}</option>
                <?php }else{ ?>
                <option value="{$key}" >{$co}</option>
                <?php } ?>
                {/foreach}
            </select>
        </div>
        {/case}

        {case value="linkage"}
        <?php $name = explode(',',$vo['name']);$key = explode(',',$vo['key']);?>
        <?php if(request()->param($key[0]) || request()->param($key[1]))$revoke = true; ?>
        <div class="layui-inline sunSelect" data-url="{$vo.value}" data-value="id" data-name="title" style="display: flex">
            <div class="layui-input-inline" style="width: 50%">
                <select name="{$key[0]}" data-name="{$name[0]}" data-id="<?php echo request()->param($key[0]);?>" lay-filter="sunSelect"></select>
            </div>
            <div class="layui-input-inline"  style="width: 50%">
                <select name="{$key[1]}" data-name="{$name[1]}" data-id="<?php echo request()->param($key[1]);?>" lay-filter="sunSelect"></select>
            </div>
        </div>
        {/case}

        {case value="time"}
        <div class="layui-inline"  style="width: 98%">
            <input class="layui-input date_range" placeholder="{$vo.name}筛选" name="{$vo.key}" value="<?php echo request()->param($vo['key']);?>" style="" autocomplete="off"/>
        </div>
        {/case}

        {default /}

        {/switch}
    </div>
    {/foreach}

</form>
<div class="layui-form-item search_btn">
    <div class="layui-inline" style="margin-left: 2%;display: flex">
        <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="search">
            查询
        </button>

        <button style="display: none" class="layui-btn layui-btn-danger layui-btn-sm resetSearch" lay-submit="" lay-filter="resetSearch">重置</button>

        {if count($search) >= 6}
        <a class="layui-btn layui-bg-red search_open layui-btn-sm">展开</a>
        {/if}
    </div>

</div>